package com.cw.controller;

import com.cw.beans.Dept;
import com.cw.mapper.DeptMapper;
import com.cw.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;

@Controller
public class DeptController {
    @Autowired
    private DeptMapper deptMapper;
    //ajax获取部门的下拉列表回显
    @ResponseBody
    @RequestMapping("/getDept")
    public ArrayList<Dept> getDept(){
        ArrayList<Dept> deptList = deptMapper.getAllDept();
        System.out.println(deptList);
        return deptList;
    }
}
